
import java.awt.*;

import javax.swing.*;
import javax.swing.border.LineBorder;

public class EastPanel extends JPanel
{
	private final int WIDTH = 100;
	private final int HEIGHT = 495;
	
	// no corner lots needed (they are on the north and south panels

	private PropertyLot PacificAve;
	private PropertyLot NorthCarolinaAve;
	private CardDrawLot Chest;
	private PropertyLot PennsylvaniaAve;
	private RailroadLot ShortLineRailroad;
	private CardDrawLot Chance;
	private PropertyLot ParkPlace;
	private TaxLot LuxuryTax;
	private PropertyLot Boardwalk;
	
	public EastPanel()
	{
		Color lightgreen = new Color(5,220,75);
		
		setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		setBackground(Color.white);
		setPreferredSize(new Dimension(WIDTH, HEIGHT));		

		PacificAve = new PropertyLot("PacificAve", "property", "east", 300, lightgreen,
				 26, 130, 390, 900, 1100, 1275, 150, 200, 200);
		NorthCarolinaAve = new PropertyLot("NorthCarolinaAve", "property", "east", 300, lightgreen,
				 26, 130, 390, 900, 1100, 1275, 150, 200, 200);
		Chest = new CardDrawLot("ChestEast", "cardDraw", "east", "CommunityChest", 3);
		PennsylvaniaAve = new PropertyLot("PennsylvaniaAve", "property", "east", 320, lightgreen,
				 28, 150, 450, 1000, 1200, 1400, 160, 200, 200);
		ShortLineRailroad = new RailroadLot("ShortLineRailroad", "railroad", "east");
		Chance = new CardDrawLot("ChanceEast", "cardDraw", "east", "Chance", 3);
		ParkPlace = new PropertyLot("ParkPlace", "property", "east", 350, Color.blue,
				 35, 175, 500, 1100, 1300, 1500, 175, 200, 200);
		LuxuryTax = new TaxLot("LuxuryTax", "tax", "east");
		Boardwalk = new PropertyLot("Boardwalk", "property", "east", 400, Color.blue,
				 50, 200, 600, 1400, 1700, 2000, 200, 200, 200);
		
		add(PacificAve);
		add(NorthCarolinaAve);
		add(Chest);
		add(PennsylvaniaAve);
		add(ShortLineRailroad);
		add(Chance);
		add(ParkPlace);
		add(LuxuryTax);
		add(Boardwalk);		
	} // end EastPanel constructor
	
	public void buildHouses(int num, String name)
	{
		if(name == "PacificAve")
		{
			PacificAve.setNumHouses(num);
		}
		else if(name == "NorthCarolinaAve")
		{
			NorthCarolinaAve.setNumHouses(num);
		}
		else if(name == "PennsylvaniaAve")
		{
			PennsylvaniaAve.setNumHouses(num);
		}
		else if(name == "ParkPlace")
		{
			ParkPlace.setNumHouses(num);
		}
		else if(name == "Boardwalk")
		{
			Boardwalk.setNumHouses(num);
		}
	}
	
	public void removeAllHouses(String name)
	{
		if(name == "PacificAve")
		{
			PacificAve.setNumHouses(0);
		}
		else if(name == "NorthCarolinaAve")
		{
			NorthCarolinaAve.setNumHouses(0);
		}
		else if(name == "PennsylvaniaAve")
		{
			PennsylvaniaAve.setNumHouses(0);
		}
		else if(name == "ParkPlace")
		{
			ParkPlace.setNumHouses(0);
		}
		else if(name == "Boardwalk")
		{
			Boardwalk.setNumHouses(0);
		}
	}
	
	public void buildHotel(String name)
	{
		if(name == "PacificAve")
		{
			PacificAve.setNumHotels(1);
		}
		else if(name == "NorthCarolinaAve")
		{
			NorthCarolinaAve.setNumHotels(1);
		}
		else if(name == "PennsylvaniaAve")
		{
			PennsylvaniaAve.setNumHotels(1);
		}
		else if(name == "ParkPlace")
		{
			ParkPlace.setNumHotels(1);
		}
		else if(name == "Boardwalk")
		{
			Boardwalk.setNumHotels(1);
		}
	}
} // end class EastPanel